/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package eu.easyedu.dictionary.api.options;

import eu.easyedu.dictionary.api.resources.Bundle;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import org.netbeans.spi.options.OptionsCategory;
import org.netbeans.spi.options.OptionsPanelController;
import org.openide.util.ImageUtilities;

/**
 *
 * @author hlavki
 */
public class GeneralOptionsCategory extends OptionsCategory {

    private String categoryName;
    private Icon icon;

    /** Creates a new instance of GeneralOptionsCategory */
    public GeneralOptionsCategory() {
        categoryName = Bundle.getMessage("CTL_GeneralOptionsCategory");
        String iconPath = Bundle.getMessage("ICON_GeneralOptionsCategory");
        try {
            icon = new ImageIcon(ImageUtilities.loadImage(iconPath, true));
        } catch (Exception ex) {
        // do nothing
        }
    }

    /** {@inheritDoc} */
    public String getCategoryName() {
        return categoryName;
    }

    /** {@inheritDoc} */
    public String getTitle() {
        return getCategoryName();
    }

    /** {@inheritDoc} */
    @Override
    public Icon getIcon() {
        return icon;
    }

    /** {@inheritDoc} */
    public OptionsPanelController create() {
        DictionaryOptionsPanelController controller = new DictionaryOptionsPanelController();
        return controller;
    }
}
